﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Infrastructure;
using System.ComponentModel.Composition;
using Microsoft.Practices.Prism.Regions;

namespace Navigation.Views
{
    public partial class NavigationView : UserControl
    {
        private static Uri DashboardViewUri = new Uri(ViewNames.DashboardView, UriKind.Relative);
        private static Uri ChemicalInventoryUri = new Uri(ViewNames.ChemicalInventory, UriKind.Relative);

        [Import]
        public IRegionManager regionManager;
        public IRegion contentRegion;

        public NavigationView()
        {
            InitializeComponent();
        }

        private void mainRibbon_OnSelectionTabChanged(object sender, SelectionChangedEventArgs e)
        {
            switch(mainRibbon.Tabs.SelectedIndex)
            {
                case 0:
                    MessageBox.Show("0");
                    regionManager.RequestNavigate(RegionNames.ContentRegion, "DashboardView");
                    break;
                case 1:
                    regionManager.RequestNavigate(RegionNames.ContentRegion, "ChemicalInventory");
                    break;
                default:
                    break;
            }
            MessageBox.Show(mainRibbon.Tabs.SelectedIndex.ToString());
        }

        private void btnTasks_OnClick(object sender, RoutedEventArgs e)
        {
            
        }

        private void mainRibbon_Loaded(object sender, RoutedEventArgs e)
        {
            mainRibbon.Title += " - Welcome " + GlobalVars.Username;
        }
    }
}
